// 生成随机id
const intformat = require("biguint-format"),
  FlakeId = require("flake-idgen");
const TABLEName = "log";
const { querySql, queryOne } = require("../utils/sql");

const setLog = async (userId, operationContent) => {
  const insertQuery = `insert into ${TABLEName}(id, userId, operationContent) values(${intformat(
    new FlakeId().next(),
    "dec"
  )}, '${userId}', '${operationContent}')`;
  try {
    let res = await querySql(insertQuery);
    console.log("res", res);
  } catch (err) {}
};
module.exports = {
    setLog
}
